//
//  AppDelegate.m
//  HACDispatcher
//
//  Created by Chengjie on 2019/4/24.
//  Copyright © 2019 Happy. All rights reserved.
//

#import "AppDelegate.h"
#import "HACAppDelegateDispatcher.h"

@interface AppDelegate ()
@property (nonatomic, strong) HACAppDelegateDispatcher *dispatcher;
@end

@implementation AppDelegate

- (HACAppDelegateDispatcher *)dispatcher {
    if (!_dispatcher) {
        _dispatcher = [[HACAppDelegateDispatcher alloc] initWithDlegates:@[
                                                                           @"HACTestAppDelegate",
                                                                           @"HACDemoAppDelegate",
                                                                           ]
                       ];
    }
    return _dispatcher;
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    return [self.dispatcher application:application didFinishLaunchingWithOptions:launchOptions];
}

- (void)applicationWillResignActive:(UIApplication *)application {
    [self.dispatcher applicationWillResignActive:application];
}

- (void)applicationDidEnterBackground:(UIApplication *)application {
    [self.dispatcher applicationDidEnterBackground:application];
}

- (void)applicationWillEnterForeground:(UIApplication *)application {
    [self.dispatcher applicationWillEnterForeground:application];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    [self.dispatcher applicationDidBecomeActive:application];
}

- (void)applicationWillTerminate:(UIApplication *)application {
    [self.dispatcher applicationWillTerminate:application];
}

@end
